import request from '@/utils/request'

/**
 * @param {Object} data 工资信息
 * 计算税后薪资
 */
export function calc(data) {
	return request({
		url: '/calculator/salary/calc',
		method: 'POST',
		loading: true,
		data
	})
}

/**
 * @param {Object} cityCode 城市
 * 获取社保公积金缴纳基数及比例
 */
export function getSocialRate(cityCode) {
	return request({
		url: `/calculator/salary/getSocialRate?cityCode=${cityCode}`,
		method: 'POST',
		data: {},
		loading: false
	})
}

/**
 * @param {Object} calcType 类型 1-综合计税税率 2-年终奖单独计税税率
 * 税率表
 */
export function getTaxRate(calcType) {
	return request({
		url: `/calculator/salary/getTaxRate?calcType=${calcType}`,
		method: 'POST',
		loading: false
	})
}